# 定义了一个SRC_LIST变量，包含了该目录下所有的源文件
aux_source_directory(. SRC_LIST)
aux_source_directory(./db DB_LIST)
aux_source_directory(./model MODEL_LIST)
aux_source_directory(./redis REDIS_LIST)


find_library(HIREDIS_LIB hiredis)
if (NOT HIREDIS_LIB)
    message(FATAL_ERROR "hiredis library not found. Please install hiredis.")
endif()


# 指定生成可执行文件
add_executable(ChatServer.exe ${SRC_LIST} ${DB_LIST} ${MODEL_LIST} ${REDIS_LIST})
# 指定可执行文件链接时需要依赖的库文件
target_link_libraries(ChatServer.exe muduo_net muduo_base mysqlclient  pthread  ${HIREDIS_LIB})